package com.lwb.ztx.lives.presenter;

import android.content.Context;

import com.lwb.ztx.bean.LiveBean;
import com.lwb.ztx.lives.model.LiveModel;
import com.lwb.ztx.lives.model.LiveModelImpl;
import com.lwb.ztx.lives.view.LiveView;

import java.util.List;

/**
 * Created by luweibin on 2016/6/13.
 */
public class LivePresenterImpl implements LivePresenter,LiveModelImpl.OnReadLivesFinishListener {
    private LiveModel liveModel;
    private LiveView liveView;
    public LivePresenterImpl(LiveView liveView) {
        liveModel = new LiveModelImpl(this);
        this.liveView = liveView;
    }

    @Override
    public void getLives(Context context) {
        liveModel.readLiveFile(context);
    }

    @Override
    public void onReadSuccess(List<LiveBean> beans) {
        liveView.addLives(beans);
    }
}
